package com.kevin.file.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import com.kevin.file.config.FeignConfig;
import com.kevin.file.feign.fallback.FileFeignFallback;


@Component
@FeignClient(name = "fileFeign", url = "${file-service.url}", configuration = FeignConfig.class, fallbackFactory = FileFeignFallback.class)
public interface FileFeign {
	@PostMapping(value = "/fileUpload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	String fileUpload(@RequestPart("file") MultipartFile file);
}
